import React from "/src/lib/react";
const ipcRenderer = window.require('electron').ipcRenderer;
class Generate extends React.Component {
	constructor(props) {
		super(props);
		this.state = {
			selector: '',
			code: '',
		};
	}


	createApp() {
		console.log("createApp")
		ipcRenderer.send("launch-app");
	}
	createTest() {
		console.log("createTest")
		ipcRenderer.send("fill-input", Math.random());
	}
	runTest() {
		ipcRenderer.send("btn-click");

	}



	render() {
		const { code, selector } = this.state;
		return <div>
			<div className="container">
				<div className="toolbar">
					<h3>功能区 :</h3>
					<button onClick={this.createApp.bind(this)}>1 - 启动app</button>
					<button onClick={this.createTest.bind(this)}>2 - input输入</button>
					<div>
						<button onClick={this.runTest.bind(this)}>3  -  按钮点击</button>
					</div>

				</div>

			</div>

		</div>;
	}
}

export default Generate;
